package com.bluetrum.devicemanager.cmd.request;

import com.bluetrum.devicemanager.cmd.Request;
import com.bluetrum.devicemanager.models.SpatialAudioMode;

public final class SpatialAudioModeRequest extends Request {

    private final SpatialAudioMode mode;

    public SpatialAudioModeRequest(SpatialAudioMode mode) {
        super(COMMAND_SPATIAL_AUDIO_MODE);
        this.mode = mode;
    }

    /**
     * 不支持Head Tracking可以使用这个简化
     * @param on 开关
     */
    public SpatialAudioModeRequest(boolean on) {
        this(new SpatialAudioMode(on));
    }

    @Override
    public byte[] getPayload() {
        return new byte[] { mode.getMode() };
    }
}
